using Common.Enumerations;
using Newtonsoft.Json;
using PetaPoco;
using Sanelib.DataView;

namespace Common.Views
{
	[TableName("ContactView")]
	public class ContactView : AuditedView
	{
		public string LastName { get; set; }
		public string FirstName { get; set; }
        [JsonIgnore]
        public NameTitle NameTitle { get; set; }
        public string NameTitleValue { get { return NameTitle == null ? "" : NameTitle.Value; } set { NameTitle = NameTitle.FromValue(value); } }
        public string NameTitleName { get { return NameTitle == null ? "" : NameTitle.DisplayName; } set { NameTitle = NameTitle.FromDisplay(value); } }
		
		public string Email { get; set; }
		public string Phone { get; set; }
		public string Mobile { get; set; }
		public string CompanyName { get; set; }
        [JsonIgnore]
        public Designation Designation { get; set; }
        public string DesignationValue { get { return Designation == null ? "" : Designation.Value; } set { Designation = Designation.FromValue(value); } }
        public string DesignationName { get { return Designation == null ? "" : Designation.DisplayName; } set { Designation = Designation.FromDisplay(value); } }
	}
}
